package com.pkx.guide.qianfeng.service;

import java.io.IOException;
import java.net.Socket;

/**
 * Socket业务接口
 */
public interface QianFengSocketService {

    /**
     * 创建连接
     * @param host
     * @param port
     * @return
     */
    Socket create(String host, Integer port) throws IOException;

    /**
     * 发送
     * @param bytes
     * @param socket
     */
    void send(byte[] bytes,Socket socket);

    /**
     * 回执
     * @param socket
     * @return
     */
    byte[] receive(Socket socket);


    /**
     * 回执2
     * @param socket
     * @return
     */
    byte[] receives(Socket socket) throws IOException;

    Socket creates(String ip, Integer port) throws IOException;

    Socket createTcps(String ip, Integer port) throws IOException;
}
